// const Tokenname = 'tokens'

export const setToken = (token) => {
  localStorage.setItem('tokens', JSON.stringify(token))
}
export const removeToken = () => {
  localStorage.removeItem('tokens')
}
export const getToken = () => {
  return JSON.parse(localStorage.getItem('tokens')) || []
}

export const setStroageChanenel = (payload) => {
  console.log(1)
  console.log(payload)
  localStorage.setItem('ChangelStroage', JSON.stringify(payload))
}
export const getStroageChannel = () => {
  return JSON.parse(localStorage.getItem('ChangelStroage'))
}

// 存搜索的历史记录
export function setStroageSearchHistory(payload) {
  localStorage.setItem('searchList', JSON.stringify(payload))
}

export function getStroageSearchHistory() {
  return JSON.parse(localStorage.getItem('searchList')) || []
}
